cmake_minimum_required (VERSION 3.1)

set(CMAKE_CXX_STANDARD 11)

project(AcqToGPU_OCT_CUDA)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/../../../cmake/Modules/")

install(FILES ${CMAKE_CURRENT_LIST_DIR}/AcqToGPU_OCT.cpp DESTINATION oct/Samples_C/AcqToGPU_OCT_CUDA_AllBoards)
install(FILES ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION oct/Samples_C/AcqToGPU_OCT_CUDA_AllBoards)

if (WIN32)
    install(FILES ${CMAKE_CURRENT_LIST_DIR}/AcqToGPU_OCT.sln DESTINATION oct/Samples_C/AcqToGPU_OCT_CUDA_AllBoards)
    install(FILES ${CMAKE_CURRENT_LIST_DIR}/AcqToGPU_OCT.vcxproj DESTINATION oct/Samples_C/AcqToGPU_OCT_CUDA_AllBoards)
endif(WIN32)

include_directories (${CMAKE_CURRENT_LIST_DIR}/../../include)
include_directories (${CMAKE_CURRENT_LIST_DIR}/../../../base/include)

find_package(LibAlazar REQUIRED)
include_directories(${LIBALAZAR_INCLUDE_DIRS})
set(LIBS ${LIBS} ${LIBALAZAR_LIBRARIES})

find_package(CUDA REQUIRED)
include_directories (${CUDA_INCLUDE_DIRS})
set(LIBS ${LIBS} ${CUDA_LIBRARIES})

if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
    link_directories(../../library/x64)
    link_directories(../../../base/library/x64)
else ( CMAKE_SIZEOF_VOID_P EQUAL 8 )
    link_directories(../../library/Win32)
    link_directories(../../../base/library/Win32)
endif( CMAKE_SIZEOF_VOID_P EQUAL 8 )


add_executable (AcqToGPU_OCT_CUDA AcqToGPU_OCT.cpp)
target_link_libraries(AcqToGPU_OCT_CUDA ${LIBS})
target_link_libraries(AcqToGPU_OCT_CUDA ATS_GPU)
target_link_libraries(AcqToGPU_OCT_CUDA ATS_CUDA)
target_link_libraries(AcqToGPU_OCT_CUDA ATS_GPU_OCT)
target_link_libraries(AcqToGPU_OCT_CUDA ATS_CUDA_OCT)

target_compile_options(AcqToGPU_OCT_CUDA PRIVATE -D_CRT_SECURE_NO_WARNINGS)